#ifndef CADREPUNISHTAB_H
#define CADREPUNISHTAB_H

#include <QWidget>
#include <QSqlTableModel>
#include <QSqlRelationalTableModel>

namespace Ui {
class CadrePunishTab;
}

class CadrePunishTab : public QWidget
{
    Q_OBJECT

public:
    explicit CadrePunishTab(QWidget *parent = 0);
    ~CadrePunishTab();
    void initPunishTableView(QString curPerson);
    void setButtonEnable(bool i);

private slots:
    void on_punishAddButton_clicked();

    void on_punishDeleteButton_clicked();

    void on_punishUpButton_clicked();

    void on_punishDownButton_clicked();

private:
    Ui::CadrePunishTab *ui;
    QSqlRelationalTableModel *punishModel;
    QString currentPerson;
    QSqlTableModel* getOriginalModel();
    QHash<QString,QString> phash;
};

#endif // CADREPUNISHTAB_H
